home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
winter_challenge.swf
/
scripts
/
DefineSprite_225
/
frame_1
/
PlaceObject2_224_1
/
CLIPACTIONRECORD onClipEvent(load).as
< prev
Wrap
Text File
|
2011-08-19
|
2KB
|
62 lines
onClipEvent(load){
function doHoppel()
{
frameCounter_1++;
frameCounter_2++;
if(frameCounter_1 <= frame_1_duration)
{
this.gotoAndStop(2);
}
if(frameCounter_1 > frame_1_duration && frameCounter_2 <= frame_2_duration)
{
newPos_y = rabbitSpeed * Math.sin(radian);
newPos_x = rabbitSpeed * Math.cos(radian);
prePos_x = _parent._x + newPos_x;
prePos_y = _parent._y + newPos_y;
if(_root.track_1.hitTest(prePos_x,prePos_y,true))
{
newPos_x = 0;
newPos_y = 0;
}
else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
{
newPos_x = 0;
newPos_y = 0;
}
else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
{
newPos_x = 0;
newPos_y = 0;
}
else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
{
newPos_x = 0;
newPos_y = 0;
}
else
{
this.gotoAndStop(3);
}
_parent._x += newPos_x;
_parent._y += newPos_y;
}
if(frameCounter_1 > frame_1_duration && frameCounter_2 > frame_2_duration)
{
this.gotoAndStop(1);
frameCounter_1 = 0;
frameCounter_2 = 0;
doHoppel_flag = 0;
}
}
frameCounter_1 = 0;
frameCounter_2 = 0;
frame_1_duration = 2;
frame_2_duration = 4;
newPos_x = _parent._x;
newPos_y = _parent._y;
rabbitSpeed = 3 + random(10);
PI = 3.141592653589793;
doHoppel_flag = 0;
gothit_flag = 0;
}